﻿using CefSharp;
using CefSharp.SchemeHandler;
using System;
using System.Collections.Generic;
using System.IO;
using System.Text;

namespace CodeGenerateEngine.SchemeFactory
{
    /// <summary>
    /// 本地资源访问服务
    /// </summary>
    internal class ResourceSchemeHandlerFactory
    {
        public static CefCustomScheme GetInstance(string SchemeName, string DomainName, string localFileResourceDirectory)
        {
            return new CefCustomScheme()
            {
                SchemeName = SchemeName,
                DomainName = DomainName,
                SchemeHandlerFactory = new FolderSchemeHandlerFactory(rootFolder: localFileResourceDirectory, schemeName: SchemeName, hostName: DomainName)
            };
        }

    }
}
